<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@include file="/common/header.jsp"%>
<html>
<head>
<style type="text/css">
	.span_left{margin-left: 30px}
</style>
</head>
<body class="easyui-layout list_body">
	<form id="logChannelStlForm" name="logChannelStlForm">
		<div class="list_body_north" data-options="region:'north'" border="false">
			<!-- 查询表单 -->
			<div style="padding: 3px" class="easyui-panel datagrid-toolbar">
				<div>
					<span>申请开始日期:</span>
					<input type="text" id="loc_dt" name="loc_dt" class="easyui-datebox" data-options="editable:false"/>
					<span class="span_left">申请结束日期:</span>
					<input type="text" id="loc_ts" name="loc_ts" class="easyui-datebox" data-options="editable:false"/>
					<span class="span_left">所属渠道:</span>
					<select id="channel_no" class="easyui-combobox" name="channel_no" style="width:230px;">
					    <option value="">--请选择渠道--</option>
					    <c:if test="${channels != null}">
					    	<c:forEach items="${channels}" var="channel">
							    <option value="${channel.ID}">${channel.TEXT}</option>
					    	</c:forEach>
					    </c:if>
					</select>
					<span class="span_left">清算状态:</span>
					<code:codeSelect id="stlst" name="stlst" code_type="STLST" showSelect="true"></code:codeSelect><br/>
					<span class="span_left">响应码:</span>
					<code:codeSelect id="rspcode" name="rspcode" code_type="RSPCODE" showSelect="true"></code:codeSelect>
					<span>会员编号:</span>
					<input type="text" id="custom_no" name="custom_no" class="easyui-textbox" /> 
					<span class="span_left">会员名称:</span> 
					<input type="text" id="customerName" name="name" class="easyui-textbox" /><br/>
					<span class="span_left">登陆账号:</span>
					<input type="text" id="login_id" name="login_id" class="easyui-textbox" /> 
					<span class="span_left">本地流水号:</span>
					<input type="text" id="loc_trace_no" name="loc_trace_no" class="easyui-textbox" /> 
					<span class="span_left">渠道方清算流水号:</span>
					<input type="text" id="channel_trace_no" name="channel_trace_no" class="easyui-textbox" /> 
					<a href="#" class="easyui-linkbutton btn" iconCls="icon-search" onclick="doSearch()">查询</a>
					<a href="#" class="easyui-linkbutton btn" iconCls="icon-reload" onclick="resetCurForm()">重置</a>
				</div>
			</div>
			<jiepos:buttonOperateTag menuCode="${menuCode}"></jiepos:buttonOperateTag>
		</div>
		<div data-options="region:'center'" border="false" class="list_body_center">
			<!-- 表格 -->
			<table id="logChannelStlTable" fit="true"></table>
		</div>
	</form>
</body>
<script type="text/javascript">
	var grid;
	$(function() {
		init();
		/*加载表格数据*/
		grid = $("#logChannelStlTable").jpgrid({
			url : "jsonList.do",
			baseColumns: false,
			columns : [
				{title: "申请时间", field: "LOC_TIME", align: 'center', width: 150},
				{title: "请求序列号", field: "REQ_SN_NO", align: 'center', width: 150},
				{title: "本地流水号", field: "LOC_TRACE_NO", align: 'center', width: 150},
				{title: "会员编号", field: "CUSTOM_NO", align: 'center', width: 150},
				{title: "登陆账号", field: "LOGIN_ID", align: 'center', width: 90},
				{title: "会员名称", field: "CUSTOM_NAME", align: 'center', width: 90},
				{title: "渠道编号-名称", field: "CHANNEL_NO", align: 'center', width: 230},
				{title: "渠道方清算流水号", field: "CHANNEL_TRACE_NO", align: 'center', width: 130},
				{title: "易宝收款宝流水号", field: "YEEPAY_SERIALNO", align: 'center', width: 280},
				{title: "申请金额", field: "APPLY_AMT", align: 'center', width: 80},
				{title: "手续费", field: "FEE", align: 'center', width: 80},
				{title: "清算金额", field: "STL_AMT", align: 'center', width: 80},
				{title: "清算时间", field: "STL_TIME", align: 'center', width: 150},
				{title: "清算状态", field: "STLST", align: 'center', width: 80},
				{title: "响应码-内容", field: "RSPCODE", align: 'center', width: 210}
			]
		});
	});
	
	function doSearch() {
		var array = $("form").serializeArray();
		var params = {};
		$.each(array, function(i, object){
			params[object.name] = object.value;
		});
		grid.load(params);
	}
	
	function exportFile(url){
		commonFileDownload(url, "logChannelStlForm");
	}
	
	function init(){
		$('#loc_dt').datebox('setValue', currentDate);
		$('#loc_ts').datebox('setValue', currentDate);
	}
	
	//重置表单
	function resetCurForm(){
		resetForm();
		init();
	}
</script>
</html>
